group { name: "elm/naviframe/item/basic/default";
   parts {
      // this set of limits and bottoms is evil - but it's a nasty construct
      // allowing EITHER the title and subtitle texts OR the prev/next button
      // swallows to control the lower bounds of the naviframe title, depending
      // on which is taller
#define BOTTOMMAX() \
      part { name: "limit0"; type: SPACER; \
         description { state: "default" 0.0; \
            rel1.to_y: "title3"; \
            rel1.relative: 0.0 1.0; \
            rel2.to_y: "elm.swallow.next_btn"; \
            rel2.offset: -1 0; \
            align: 0.5 1.0; \
            fixed: 0 1; \
            limit: HEIGHT; \
         } \
      } \
      part { name: "limit1"; type: SPACER; \
         description { state: "default" 0.0; \
            rel1.to_y: "elm.swallow.next_btn"; \
            rel1.relative: 0.0 1.0; \
            rel2.to_y: "title3"; \
            rel2.offset: -1 0; \
            align: 0.5 1.0; \
            fixed: 0 1; \
            limit: HEIGHT; \
         } \
      } \
      part { name: "bottom0"; type: SPACER; \
         description { state: "default" 0.0; \
            rel1.to_y: "limit1"; \
            rel1.relative: 0.0 1.0; \
            rel2.to_y: "limit0"; \
            rel2.offset: -1 0; \
            align: 0.5 1.0; \
            fixed: 0 1; \
            limit: HEIGHT; \
         } \
         description { state: "other" 0.0; \
            inherit: "default" 0.0; \
            rel1.to_y: "limit0"; \
            rel2.to_y: "limit1"; \
         } \
      } \
      program { name: "pbot0"; \
         signal: "limit,height,zero"; source: "bottom0"; \
         script { \
            new st[31], Float:vl; \
            get_state(PART:"bottom0", st, 30, vl); \
            if (st[0] == 'd') set_state(PART:"bottom0", "other", 1.0); \
            else set_state(PART:"bottom0", "default", 1.0); \
         } \
      } \
      part { name: "limit2"; type: SPACER; \
         description { state: "default" 0.0; \
            rel1.to_y: "title3"; \
            rel1.relative: 0.0 1.0; \
            rel2.to_y: "elm.swallow.prev_btn"; \
            rel2.offset: -1 0; \
            align: 0.5 1.0; \
            fixed: 0 1; \
            limit: HEIGHT; \
         } \
      } \
      part { name: "limit3"; type: SPACER; \
         description { state: "default" 0.0; \
            rel1.to_y: "elm.swallow.prev_btn"; \
            rel1.relative: 0.0 1.0; \
            rel2.to_y: "title3"; \
            rel2.offset: -1 0; \
            align: 0.5 1.0; \
            fixed: 0 1; \
            limit: HEIGHT; \
         } \
      } \
      part { name: "bottom1"; type: SPACER; \
         description { state: "default" 0.0; \
            rel1.to_y: "limit3"; \
            rel1.relative: 0.0 1.0; \
            rel2.to_y: "limit2"; \
            rel2.offset: -1 0; \
            align: 0.5 1.0; \
            fixed: 0 1; \
            limit: HEIGHT; \
         } \
         description { state: "other" 0.0; \
            inherit: "default" 0.0; \
            rel1.to_y: "limit2"; \
            rel2.to_y: "limit3"; \
         } \
      } \
      program { name: "pbot1"; \
         signal: "limit,height,zero"; source: "bottom1"; \
         script { \
            new st[31], Float:vl; \
            get_state(PART:"bottom1", st, 30, vl); \
            if (st[0] == 'd') set_state(PART:"bottom1", "other", 1.0); \
            else set_state(PART:"bottom1", "default", 1.0); \
         } \
      } \
      part { name: "bottom"; type: SPACER; \
         description { state: "default" 0.0; \
            rel1.to_y: "bottom1"; \
            rel1.offset: 0 -1; \
            rel1.relative: 0.0 1.0; \
            rel2.to_y: "bottom0"; \
            align: 0.5 1.0; \
            fixed: 0 1; \
            limit: HEIGHT; \
         } \
         description { state: "other" 0.0; \
            inherit: "default" 0.0; \
            rel1.to_y: "bottom0"; \
            rel2.to_y: "bottom1"; \
         } \
      } \
      program { name: "pbot"; \
         signal: "limit,height,zero"; source: "bottom"; \
         script { \
            new st[31], Float:vl; \
            get_state(PART:"bottom", st, 30, vl); \
            if (st[0] == 'd') set_state(PART:"bottom", "other", 1.0); \
            else set_state(PART:"bottom", "default", 1.0); \
         } \
      }
      BOTTOMMAX()

      part { name: "title1"; type: TEXT;
         scale: 1;
         description { state: "default" 0.0;
            rel1.relative: 0.0 0.0;
            rel1.offset: 4 4;
            rel2.relative: 1.0 0.0;
            rel2.offset: -5 4;
            align: 0.5 0.0;
            min: 40 24;
            text { font: FN; size: 8;
               text: SPACER_TEXT;
               text_class: "title_bar_sub";
               align: 0.5 0.0;
               min: 0 1;
            }
            fixed: 0 1;
            visible: 0;
         }
      }
      part { name: "title2"; type: TEXT;
         scale: 1;
         description { state: "default" 0.0;
            rel1.to_y: "title1";
            rel1.relative: 0.0 1.0;
            rel1.offset: 0 0;
            rel2.to_y: "title1";
            rel2.offset: -1 -1;
            align: 0.5 0.0;
            text { font: FNBD; size: 10;
               text: SPACER_TEXT;
               text_class: "title_bar";
               align: 0.5 0.0;
               min: 0 1;
            }
            fixed: 0 1;
            visible: 0;
         }
      }
      part { name: "title3"; type: TEXT;
         scale: 1;
         description { state: "default" 0.0;
            rel1.to_y: "title2";
            rel1.relative: 0.0 1.0;
            rel1.offset: 0 0;
            rel2.to_y: "title2";
            rel2.offset: -1 -1;
            align: 0.5 0.0;
            text { font: FN; size: 8;
               text: SPACER_TEXT;
               text_class: "title_bar_sub";
               align: 0.5 0.0;
               min: 0 1;
            }
            fixed: 0 1;
            visible: 0;
         }
      }

      part { name: "clip"; type: RECT;
         description { state: "default" 0.0;
         }
      }
      part { name: "top_clip"; type: RECT;
         clip_to: "clip";
         description { state: "default" 0.0;
         }
      }
      part { name: "base"; type: SPACER;
         description { state: "default" 0.0;
         }
         description { state: "prev" 0.0;
            inherit: "default" 0.0;
            rel1.relative: -1.0 0.0;
            rel2.relative: 0.0 1.0;
         }
         description { state: "next" 0.0;
            inherit: "default" 0.0;
            rel1.relative: 1.0 0.0;
            rel2.relative: 2.0 1.0;
         }
      }
      part { name: "elm.swallow.content"; type: SWALLOW;
         clip_to: "clip";
         description { state: "default" 0.0;
            rel1.to: "top";
            rel1.relative: 0.0 1.0;
            rel2.to: "base";
         }
         description { state: "title-hidden" 0.0;
            inherit: "default" 0.0;
            rel1.to: "base";
            rel1.relative: 0.0 0.0;
         }
      }
      part { name: "tophide0"; type: SPACER;
         description { state: "default" 0.0;
            rel1.to: "base";
            rel2.to_x: "base";
            rel2.to_y: "bottom";
         }
      }
      part { name: "tophide1"; type: SPACER;
         description { state: "default" 0.0;
            rel1.to: "tophide0";
            rel1.relative: 0.0 -1.0;
            rel2.to: "tophide0";
         }
      }
      part { name: "top"; type: RECT;
         scale: 1;
         clip_to: "top_clip";
         description { state: "default" 0.0;
            color_class: "/bg/normal/naviframe/top";
            rel1.to: "base";
            rel2.to_x: "base";
            rel2.to_y: "bottom";
         }
         description { state: "title-hidden" 0.0;
            inherit: "default" 0.0;
            rel1.to: "tophide1";
            rel2.to: "base";
            rel2.relative: 1.0 0.0;
         }
      }
      part { name: "access.title"; type: RECT; repeat_events: 1;
         clip_to: "clip";
         description { state: "default" 0.0;
            fixed: 1 1;
            color: 0 0 0 0; // no cc
            rel.to: "top";
         }
      }
      part { name: "elm.text.title"; type: TEXT; mouse_events: 0;
         scale: 1;
         clip_to: "elements_clip";
         description { state: "default" 0.0;
            color_class: "/fg/normal/naviframe/text/title";
            rel1.offset: 4 14;
            rel1.to_x: "base";
            rel1.to_y: "top";
            rel2.offset: -5 -15;
            rel2.to_x: "base";
            rel2.to_y: "top";
            align: 0.5 0.5;
            text { font: FNBD; size: 10;
               text_class: "title_bar";
               align: 0.5 0.5;
               min: 0 1;
            }
            fixed: 0 1;
            offscale;
         }
         description { state: "hidden" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "elm.text.subtitle"; type: TEXT; mouse_events: 0;
         scale: 1;
         clip_to: "elements_clip";
         description { state: "default" 0.0;
            color_class: "/fg/normal/naviframe/text/subtitle";
            rel1.to_x: "base";
            rel1.to_y: "top";
            rel1.relative: 0.0 1.0;
            rel1.offset: 4 -5;
            rel2.to_x: "base";
            rel2.to_y: "top";
            rel2.offset: -5 -5;
            align: 0.5 1.0;
            text { font: FN; size: 8;
               text_class: "title_bar_sub";
               align: 0.5 1.0;
               min: 0 1;
            }
            fixed: 0 1;
            offscale;
         }
         description { state: "hidden" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "buttons_clip"; type: RECT;
         clip_to: "elements_clip";
         description { state: "default" 0.0;
            rel.to: "base";
         }
         description { state: "title-hidden" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "elm.swallow.next_btn"; type: SWALLOW;
         scale: 1;
         clip_to: "buttons_clip";
         description { state: "default" 0.0;
            rel1.to_x: "base";
//            rel1.to_y: "top";
            rel1.relative: 1.0 0.0;
            rel1.offset: -5 4;
            rel2.to_x: "base";
            rel2.to_y: "title3";
            rel2.offset: -5 -5;
            align: 1.0 0.5;
            min: 26 26;
            max: 1 1;
            fixed: 1 1;
         }
         description { state: "title-hidden" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "elm.swallow.prev_btn"; type: SWALLOW;
         scale: 1;
         clip_to: "buttons_clip";
         description { state: "default" 0.0;
            rel1.to_x: "base";
//            rel1.to_y: "top";
            rel1.offset: 4 4;
            rel2.relative: 0.0 1.0;
            rel2.offset: 4 -5;
            rel2.to_x: "base";
            rel2.to_y: "title3";
            align: 0.0 0.5;
            min: 26 26;
            max: 1 1;
            fixed: 1 1;
         }
         description { state: "title-hidden" 0.0;
            inherit: "default" 0.0;
            visible: 0;
         }
      }
      part { name: "elm.swallow.icon"; type: SWALLOW;
         clip_to: "elements_clip";
         description { state: "default" 0.0;
            fixed: 1 0;
            rel1.to_x: "elm.swallow.prev_btn";
            rel1.to_y: "top";
            rel1.relative: 1.0 0.0;
            rel1.offset: 4 4;
            rel2.to_x: "elm.swallow.prev_btn";
            rel2.to_y: "top";
            rel2.offset: 4 -5;
            aspect: 1.0 1.0; aspect_preference: VERTICAL;
            align: 0.0 0.5;
         }
         description { state: "hidden" 0.0;
            inherit: "default" 0.0;
            rel1.to_x: "top";
            rel1.relative: 0.0 0.0;
            rel2.to_x: "top";
            rel2.offset: -5 -5;
            align: 0.5 0.5;
         }
      }
      part { name: "elements_clip"; type: RECT;
         clip_to: "clip";
         description { state: "default" 0.0;
            rel.to: "base";
         }
         description { state: "hidden" 0.0;
            inherit: "default" 0.0;
            color: 255 255 255 0; // no cc
            visible: 0;
         }
         description { state: "next" 0.0;
            inherit: "hidden" 0.0;
         }
         description { state: "prev" 0.0;
            inherit: "hidden" 0.0;
         }
      }
   }
   programs {
      program { signal: "elm,state,title,show"; source: "elm";
         action: STATE_SET "default" 0.0;
         target: "top";
         target: "elm.swallow.content";
         target: "buttons_clip";
         target: "elm.swallow.prev_btn";
         target: "elm.swallow.next_btn";
      }
      program { signal: "elm,action,title,show"; source: "elm";
         action: STATE_SET "default" 0.0;
         transition: DECELERATE 0.2;
         target: "top";
         target: "elm.swallow.content";
         after: "titleshow2";
      }
      program { name: "titleshow2";
         action: STATE_SET "default" 0.0;
         target: "buttons_clip";
         after: "title_transition_finished";
         target: "elm.swallow.prev_btn";
         target: "elm.swallow.next_btn";
      }
      program { signal: "elm,state,title,hide"; source: "elm";
         action: STATE_SET "title-hidden" 0.0;
         target: "buttons_clip";
         target: "top";
         target: "elm.swallow.content";
         target: "elm.swallow.prev_btn";
         target: "elm.swallow.next_btn";
      }
      program { signal: "elm,action,title,hide"; source: "elm";
         action: STATE_SET "title-hidden" 0.0;
         target: "buttons_clip";
         target: "elm.swallow.prev_btn";
         target: "elm.swallow.next_btn";
         after: "titlehide2";
      }
      program { name: "titlehide2";
         action: STATE_SET "title-hidden" 0.0;
         transition: DECEL 0.2;
         target: "top";
         target: "elm.swallow.content";
         after: "title_transition_finished";
      }
      program { name: "title_transition_finished";
         action: SIGNAL_EMIT "elm,action,title,transition,finished" "elm";
      }
      program { signal: "elm,state,prev_btn,show"; source: "elm";
         action: STATE_SET "default" 0.0;
         filter: "elm.swallow.content" "default";
         target: "elm.swallow.prev_btn";
      }
      program { signal: "elm,state,prev_btn,hide"; source: "elm";
         action: STATE_SET "title-hidden" 0.0;
         target: "elm.swallow.prev_btn";
      }
      program { signal: "elm,state,next_btn,show"; source: "elm";
         action: STATE_SET "default" 0.0;
         filter: "elm.swallow.content" "default";
         target: "elm.swallow.next_btn";
      }
      program { signal: "elm,state,next_btn,hide"; source: "elm";
         action: STATE_SET "title-hidden" 0.0;
         target: "elm.swallow.next_btn";
      }
      program { signal: "mouse,clicked,1"; source: "top";
         action: SIGNAL_EMIT "elm,action,title,clicked" "elm";
      }
      program { signal: "elm,state,title_label,show"; source: "elm";
         action: STATE_SET "default" 0.0;
         target: "elm.swallow.icon";
         target: "elm.text.title";
         target: "elm.text.subtitle";
      }
      program { signal: "elm,state,title_label,hide"; source: "elm";
         action: STATE_SET "hidden" 0.0;
         target: "elm.swallow.icon";
         target: "elm.text.title";
         target: "elm.text.subtitle";
      }
      program { signal: "elm,state,visible"; source: "elm";
         action: STATE_SET "default" 0.0;
         target: "elements_clip";
         target: "base";
      }
      program { signal: "elm,state,invisible"; source: "elm";
         action: STATE_SET "hidden" 0.0;
         target: "elements_clip";
      }

      /* current page is being pushed: [previous]<----[current] */
      program { signal: "elm,state,cur,pushed"; source: "elm";
         action: STATE_SET "default" 0.0;
         target: "base";
         target: "elements_clip";
      }
      program { signal: "elm,state,cur,pushed,deferred"; source: "elm";
         action: STATE_SET "prev" 0.0;
         transition: DECEL 0.2;
         target: "base";
         target: "elements_clip";
         after: "pushed3";
      }
      program { name: "pushed3";
         action: SIGNAL_EMIT "elm,action,pushed,finished" "elm";
      }

      /* current page is being popped: [current]---->[next] */
      program { signal: "elm,state,cur,popped"; source: "elm";
         action: STATE_SET "default" 0.0;
         target: "base";
         target: "elements_clip";
      }
      program { signal: "elm,state,cur,popped,deferred"; source: "elm";
         action: STATE_SET "next" 0.0;
         transition: DECEL 0.2;
         target: "base";
         target: "elements_clip";
         after: "popped3";
      }
      program { name: "popped3";
         action: SIGNAL_EMIT "elm,action,popped,finished" "elm";
      }

      /* new page is being pushed: [current]<----[next] */
      program { signal: "elm,state,new,pushed"; source: "elm";
         action: STATE_SET "next" 0.0;
         target: "base";
         target: "elements_clip";
      }
      program { signal: "elm,state,new,pushed,deferred"; source: "elm";
         action: STATE_SET "default" 0.0;
         transition: DECELERATE 0.2;
         target: "base";
         target: "elements_clip";
         after: "pushedb3";
      }
      program { name: "pushedb3";
         action: SIGNAL_EMIT "elm,action,show,finished" "elm";
      }

      /* previous page is being pushed: [previous]---->[current] */
      program { signal: "elm,state,prev,popped"; source: "elm";
         action: STATE_SET "prev" 0.0;
         target: "base";
         target: "elements_clip";
      }
      program { signal: "elm,state,prev,popped,deferred"; source: "elm";
         action: STATE_SET "default" 0.0;
         transition: DECELERATE 0.2;
         target: "base";
         target: "elements_clip";
         after: "poppedb3";
      }
      program { name: "poppedb3";
         action: SIGNAL_EMIT "elm,action,show,finished" "elm";
      }
   }
}

group { name: "elm/naviframe/item/overlap/default";
   inherit: "elm/naviframe/item/basic/default";
   alias: "elm/naviframe/item/overlap/pager";
   parts {
      // this is a hack around an edje_cc inherit bug - group doesnt seem
      // to inherit properly with limits etc.
      BOTTOMMAX()

      part { name: "elm.swallow.content";
         description { state: "default" 0.0;
            rel1.to: "base";
            rel1.relative: 0.0 0.0;
         }
      }
      part { name: "top_clip";
         description { state: "default" 0.0;
            color_class: "/fg/normal/naviframe/top/overlap";
         }
      }
   }
}
#undef BOTTOMMAX
